package com.gopay.common.domain.rcs;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import com.gopay.common.cipher.utils.SensitiveInfoUtils;



/**
 * 风控服务 银行账户交易额度统计表
 * @RcsTransLimitStatistics.java
 * @author liujy
 * @2013-7-19 上午9:50:21  www.gopay.com.cn Inc.All rights reserved.
 */
@Entity
@Table(name="RCS_BACCT_LIMIT_STATIC")
public class RcsBAcctLimitStatistics extends RcsTransLimitStatistics{

    /**
     * 
     */
    private static final long serialVersionUID = 1L;


    private int sq;
    
    
    private String pbocBankCode;
    
    private String bankName;
    
    private String bankAcctNum;
    
    private String bankAcctName;
    

    @Id
    @SequenceGenerator(name = "RcsTransLimitStatisticsSequence", sequenceName = "RCS_TRANS_LIMIT_STATISTICS_SEQ")
    @GeneratedValue(generator = "RcsTransLimitStatisticsSequence", strategy = GenerationType.SEQUENCE)
    public int getSq() {
        return sq;
    }

    public void setSq(int sq) {
        this.sq = sq;
    }

    @Column(name="PBOC_BANK_CODE", unique=false,nullable=true)
    public String getPbocBankCode() {
        return pbocBankCode;
    }

    public void setPbocBankCode(String pbocBankCode) {
        this.pbocBankCode = pbocBankCode;
    }

    @Column(name="BANK_NAME", unique=false,nullable=true)
    public String getBankName() {
        return bankName;
    }

    public void setBankName(String bankName) {
        this.bankName = bankName;
    }

    @Column(name="BANK_ACCT_NUM", unique=false,nullable=true)
    public String getBankAcctNum() {
    	/**
    	 * modify by zyt，2017-2-22 在程序中获取的时候进行解密操作，如果是hibernate自己调用（save等），则返回原值；
    	 */
    	this.bankAcctNum = SensitiveInfoUtils.autoReencrypt(this.bankAcctNum);
        return SensitiveInfoUtils.smartDecryptWithCheck(this.bankAcctNum);
    }

    public void setBankAcctNum(String bankAcctNum) {
    	/**
    	 * modified by zyt，2017-2-22 判断传入字符串是否经过加密，如果是，则设置为原文，否则设置为加密后的值
    	 */
    	this.bankAcctNum = SensitiveInfoUtils.smartEncryptWithCheck(bankAcctNum);
    }

    @Column(name="BANK_ACCT_NAME", unique=false,nullable=true)
    public String getBankAcctName() {
    	/**
    	 * modify by zyt，2017-2-22 在程序中获取的时候进行解密操作，如果是hibernate自己调用（save等），则返回原值；
    	 */
    	this.bankAcctName = SensitiveInfoUtils.autoReencrypt(this.bankAcctName);
        return SensitiveInfoUtils.smartDecryptWithCheck(this.bankAcctName);
    }

    public void setBankAcctName(String bankAcctName) {
    	/**
    	 * modified by zyt，2017-2-22 判断传入字符串是否经过加密，如果是，则设置为原文，否则设置为加密后的值
    	 */
    	this.bankAcctName = SensitiveInfoUtils.smartEncryptWithCheck(bankAcctName);
    }
}
